/*

	author: TangQiao , Wind @ Beijing Normal University

	problem name: Copying Books
	
	source : ZJU Online Judge
	
	problem type: 二分法
	
	problem description: 把书分成K部分,要求每部分的最大书页和最小.

	faults: 1:
	没有写这句: if( sum > pages )   return 0;
	
	date : 2005.8.8
	
*/
#include <stdio.h>
#include <string.h>

int m, k;
int book[503];
int ans[503];
int temp[503];
int min;

bool candevide(int pages)
{
	int i, sum, num;

	num=1;
	sum=0;
	
	for (i=1; i<=m ; ++i)
	{
		sum += book[i];
		if (sum > pages)
		{
			sum = book[i];
			if( sum > pages )   return 0;
			++num;
		}
	}

	if (num<=k ) return true;	
	return false;
}


void output()
{
	int i, j, num, sum;
	
	memset(ans, 0, sizeof(ans));
	num=0;
	sum=0;
//	printf("max = %d\n", min);
	for (i=m; i>=1; i--)
	{
		sum += book[i];
		if (sum > min) 
		{
			sum = book[i];
			ans[i] = 1;
			num ++;			
		}
		if ( i-1 == k-num-1 )
		{
			for (j=i-1; j>=1; j--)
				ans[j] = 1;
			break;
		}

	}

	for (i=1; i<m; ++i)
	{
		printf("%d ", book[i]);
		if (ans[i]) printf("/ ");
	}
	printf("%d\n", book[i]);
	
}

int main()
{
	int N;
	int i, j, tot, left, right, mid;

//	freopen("2002.in", "r", stdin);
	
	scanf("%d", &N);
	while (N-->0)
	{
		memset(book, 0, sizeof(book));
		memset(ans, 0, sizeof(ans));
		min = 2100000000;
		min = 2109999999;
		scanf("%d%d", &m, &k);
		for (i=1, tot=0; i<=m; tot+=book[i++])		
			scanf("%d", &book[i]);
		
		left = 0;
		right = tot;
		while ( left <= right )
		{
			mid = (left + right) / 2;
			if ( candevide(mid) )
			{
				right = mid - 1;
				if (min > mid) min = mid;
			}
			else left = mid + 1; 
		}

		output();
	}
	

	return 0;
}